package yb.ecp.fast.user.dao.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import yb.ecp.fast.user.dao.entity.DepartmentDO;

import java.util.List;

@Mapper
public interface DepartmentMapper
{

    List<DepartmentDO> queryList(@Param("deptId")String deptId, @Param("spaceId")String spaceId);

    List<DepartmentDO> queryDeptList(DepartmentDO departmentDO);
    DepartmentDO selectById(String id);

    int insert(DepartmentDO departmentDO);

    int update(DepartmentDO departmentDO);

    List<DepartmentDO> selectDeptNotEmpty(DepartmentDO departmentDO);

    int removeByCode(DepartmentDO departmentDO);

    /**
     * 校验该层级下机构名称是否存在
     *
     * @param departmentDO
     * @return
     */
    int checkName(DepartmentDO departmentDO);

    int deleteById(String id);

    String queryLastCode(@Param("parentId")String parentId,@Param("spaceId")String spaceId);

    List<DepartmentDO> selectByDeptName(@Param("deptName")String deptName, @Param("spaceId")String spaceId);
}